[#86]: feat(parser): add trace_id, forked_from_thread_id, compaction_meta fields (Codex v0.134.0/v0.135.0)#94
Open
delexw wants to merge 1 commit into
Open
[#86]: feat(parser): add trace_id, forked_from_thread_id, compaction_meta fields (Codex v0.134.0/v0.135.0)#94delexw wants to merge 1 commit into
delexw wants to merge 1 commit into
Conversation
…elds (Codex v0.134.0/v0.135.0) Implements compat for two Codex CLI releases: - v0.134.0 PR #23980: trace_id added to TurnStartedEvent. Exposed as CodexTurn.trace_id (Option<String> / string | null) for OTel correlation. - v0.135.0 PR #24160: forked_from_thread_id added to turn metadata. Exposed as CodexTurn.forked_from_thread_id so forked sessions are visible as branches rather than independent roots. - v0.135.0 PR #24368: compaction metadata added to turn headers. Adds CompactionMeta struct (tokens_before, tokens_after, summary) and CodexTurn.compaction_meta for accurate context-window accounting. All three fields are optional (null for older sessions). Adds 7 new regression tests covering presence, absence, and combined field cases. Updates shared/types.ts and four frontend test fixtures. Fixes #86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three new optional fields to the turn event parser for Codex v0.134.0/v0.135.0 compatibility.
Changes
Rust (
src-tauri/src/parser/turn.rs)trace_id(Option<String>) — extracted fromtask_startedevent payload. Added in Codex v0.134.0 (PR #23980) for OTel correlation.forked_from_thread_id(Option<String>) — extracted fromtask_startedevent payload. Added in Codex v0.135.0 (PR #24160) for session-tree reconstruction; forked sessions are visible as branches rather than independent roots.CompactionMetastruct +compaction_meta(Option<CompactionMeta>) — extracted from thecompactionkey intask_startedpayloads. Added in Codex v0.135.0 (PR #24368) for accurate context-window accounting. Fields:tokens_before,tokens_after,summary.All three fields are
Nonefor older sessions (backward compatible).TypeScript (
shared/types.ts)CompactionMetainterface mirroring the Rust struct.trace_id: string | null,forked_from_thread_id: string | null,compaction_meta: CompactionMeta | nulltoCodexTurn.Tests
TurnDetail.test.tsx,TurnList.test.tsx,ToolCallItem.test.tsx,WorkerPanel.test.tsx) to satisfy the updatedCodexTurntype.Verification
cargo test: 138/138 passnpx tsc --noEmit: cleancargo clippy -- -D warnings: cleanPOST /api/sessions): OKnpx vitest run: pre-existing failures unrelated to this change (missing test setup for@testing-library/jest-dom); all previously-passing tests still passFixes #86